<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>附件管理</title>
	<hdjs />
	<js file='__PUBLIC__/js/mod.base.js' />
	<css file="__PUBLIC__/Css/mod.base.css" />
	<script type="text/javascript">
		//预览图片
		function view_image(obj) {
			var src = $(obj).attr('src');
			var viewImg = $('#view_img');
			//删除预览图
			if (viewImg.length >= 1) {
				viewImg.remove();
			}
			//鼠标移除时删除预览图
			$(obj).mouseout(function(){
				$('#view_img').remove();
			})
			if (src) {
				var offset = $(obj).offset();
				var _left = 100+offset.left+"px";
				var _top = offset.top-50+"px";
				var html = '<img src="' + src + '" style="border:solid 5px #dcdcdc;position:absolute;z-index:1000;width:300px;left:'+_left+';top:'+_top+';" id="view_img"/>';
				$('body').append(html);
			}
		}
	</script>
</head>
<body>
	

		<form action="{:U('Attachment/operation')}" method="post" class='hd-form'>
				<div class="hd-menu-list">
					<ul>
						<li class="active">
							<a href="javascript:;" >
								附件管理
							</a>
							<!-- <a href="javascript:;" class="action">
								更新附件路径
							</a> -->
						</li>
						
					</ul>
				</div>
				<table class="hd-table hd-table-list hd-form">
					<thead>
						<tr>
							<!-- <td class="hd-w30">
							<input type="checkbox" class="select_all"/>
							</td> -->
							<td class="hd-w30">ID</td>
							<td class="hd-w100">预览</td>
							<td >文件名</td>
							<td class="hd-w100">类型</td>
							<td class="w200">路径</td>
							<td class="hd-w100">大小</td>
							<td class="hd-w100">上传时间</td>
							<td class="hd-w50">用户</td>
							<td class="hd-w50">状态</td>
							<td class="hd-w50">操作</td>
						</tr>
					</thead>
						<if condition='$data'>
						<foreach name='data' item='v'>
						<tr>
							<!-- <td>
							<input type="checkbox" name="id[{$v.id}]" value="{$v.id}"/> 
							</td>-->
							<td>{$v.id}</td>
							<td>
							<img src="__ROOT__/{$v.path}/{$v.name}.{$v.ext}" alt="预览大图"  height="50" width="100" <if condition='is_pic($v["path"]."/".$v["name"].".".$v["ext"])'>onmouseover='view_image(this)'</if> />

							</td>
							<td>{$v.name}</td>
							<td>{$v.ext}</td>
							<td>{$v.path}</td>
							<td>{$v.size}</td>
							<td>{$v.addtime|date='Y-m-d H:i:s',###}</td>
							<td>{$v.username}</td>
							<td><if condition='!$v["article_aid"]'>无效<else />有效</if></td>
							<td>
							<a href="javascript:;del_modal('{:U('del',array('id'=>$v['id']))}')">
								删除
							</a>
							</td>
						</tr>
						</foreach>
						<tr><td colspan="10" class="page">{$page}</td></tr>
						<else/>
							<tr>
								<td colspan="10">没有找到符合的记录</td>
							</tr>
						</if>
					</table>


			<!-- <input type="button" class="hd-btn hd-btn-xm"  value='全选'/>
			<input type="button" class="hd-btn hd-btn-xm"  value='反选'/> -->
			<input type="button" onclick="location.href='{:U('Upload/del_no_use_attachment')}'" class="hd-btn hd-btn-xm"  value="删除无效附件"/>		
		
		</form>


	


</body>
</html>